import request from '@/utils/request'

export default {
  //获取课程分类显示
  getNestedTreeList() {
    return request({
      url: `/eduservice/subject/getAllSubject`,
      method: 'get'

    })
  },
  //添加课程信息
  addCourseInfo(courseinfo) {
    return request({
      url: `/eduservice/course/addCourseInfo`,
      method: 'post',
      data:courseinfo

    })
  },
  getAllTeacher() {
    return request({
      url: `/eduservice/teacher/findAll`,
      method: 'get'
    })
  },
  getCourseInfoId(id){
    return request({
      url:'/eduservice/course/getCourseInfo/'+id,
      method:'get'
    })
  },
  updateCourseInfo(courseInfo) {
    return request({
      url: '/eduservice/course/updateCourseInfo',
      method: 'post',
      data: courseInfo
    })
  },
  getPublihCourseInfo(id){
    return request({
      url:'/eduservice/course/getPublishCourseInfo/'+id,
      method:'get'
    })
  },
  publihCourse(id){
    return request({
      url:'/eduservice/course/publishCourse/'+id,
      method:'post'
    })
  },
  getListCourse(){
    return request({
      url:'/eduservice/course',
      method:'get'
    })
  },
  deleteCourse(id){
   return request({
     url:'/eduservice/course/'+id,
     method:'delete'
   })
  }
}
